import java.util.*;

public class Main
{
    public static void main(String []args)
    {
	try
	{
	    Locale.setDefault((Locale.US));
	    Scanner in = new Scanner(System.in);
	    int N = in.nextInt();
	    Random rnd = new Random(System.nanoTime());
	    double v = in.nextDouble();
	    double[] G = new double [N];
	    for (int i = 0; i < N; ++i)
	    {
		double t = 1.0;
		for (int j = 0; j < v; ++j)
		    t *= rnd.nextDouble();
		G[i] = - Math.log(t);
	    }
	    double e = 0, eExp = v;
	    double d = 0, dExp = v;
	    for (double t : G)
		e += t;
	    e /= N;
	    for (double t : G)
		d += Math.pow(e - t, 2);
	    d /= N - 1;
	    
	    System.out.println(e + "\t" + eExp);
	    System.out.println(d + "\t" + dExp);
	}
	catch(Throwable e){ System.out.println(e.getMessage());}
    }
}